package vip.george.springbootiptools.config;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import vip.george.springbootiptools.interceptor.IpToolInterceptor;

@Configuration
public class MyWebConfig implements WebMvcConfigurer {


    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(interceptor()).addPathPatterns("/**");
    }


    @Bean
    public IpToolInterceptor interceptor(){
//        System.out.println("6666666666666666666666666666");
        return new IpToolInterceptor();
    }
}
